﻿@model FPP.Models.FamousPerson
@{
    ViewBag.Title = "Create";
}
<h2>
    Add a new Famous Person by simply adding their wikipedia link.</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Add a famous person to FamousPeoplePool</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.WikiLink)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.WikiLink, new { style = "width: 300px" })
            @Html.ValidationMessageFor(model => model.WikiLink)
        </div>
        <input id="previewLink" name="Preview" type="button" value="Preview Link" />
        <input id="inputCreate" type="submit" value="Create" disabled="disabled" />
        <iframe id="previewFrame" class="span-17" height="300px" src="">
        </iframe>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $("#previewLink").click(function () {
            ///put your update code here including the kb_edit code
            var link = $("#WikiLink").val();
            $("#inputCreate").removeAttr("disabled");
            $("#previewFrame").attr("src", link);
        });
    });
</script>
